﻿<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<div id="updateDialog" class="crudDialog">
	<form id="updateForm" method="post">
		<div class="form-group">
			<label for="code">盒编号</label>
			<input id="code" type="text" class="form-control" name="code" maxlength="20" autocomplete="off">
		</div>
		<div class="form-group">
			<label for="description">存放位置</label>
			<input id="description" type="text" class="form-control" name="description" maxlength="100" autocomplete="off">
		</div>
		<div class="form-group text-right dialog-buttons">
			<button class="btn btn-primary" href="javascript:;" onclick="updateSubmit();">保存</button>
			<button class="btn btn-default" href="javascript:;" onclick="updateDialog.close();">取消</button>
		</div>
	</form>
</div>
<script>
	function updateSubmit(){
        var tradOrSinRecord2= $("#tradOrSinRecord").val();
		var rows = $table.bootstrapTable("getSelections");
		var ids = new Array();
		for (var i in rows) {
		    if(tradOrSinRecord2=="0"){
                ids.push(rows[i].volId);
			}else {
                ids.push(rows[i].itemId);
			}
		}
		var code = $("#code").val();
		var description = $("#description").val();
		$.ajax({
			url:"${basePath}/manage/keep/saveBoxAndLocation",
			type:"post",
			data:{"ids":ids.join('-'),"boxCode":code,"locationCode":description,"tradOrSinRecord2":tradOrSinRecord2},
			success:function(data){
				$.alert("成功设置"+data+"条记录！");
				updateDialog.close();
                if(tradOrSinRecord2=="0"){
                    SearchArcStoragePage();
                }else {
                    SingleArchItemAction();
                }
			}
		})
	}
</script>